package com.ourteam.product.model.dao.impl;

import com.ourteam.product.model.dao.IProductModelObjectRelateDAO;
import com.ourteam.product.model.dao.ProductModelObjectRelate;
import com.ourteam.product.model.dao.ProductModelObjectRelateDAOQueryBean;

import net.dao.AbstractSpringDAO;
import net.dao.DataAccessObjectHelper;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
 * Template Name : DAO服务对象
 * Template Version : 1
 * Template Last Modfiy Date : Fri Nov 17 11:00:11 IRKT 2017
 * Auto Generate Date : 2017-11-17 11:01:14
  * Warning ! This file will be overwrite when regenerate !
  *
 */
public class AbstractProductModelObjectRelateDAOJdbcImpl
    extends AbstractSpringDAO implements IProductModelObjectRelateDAO {
    public static final String[] ENTITY_FIELDS = new String[] {
            Id, RelateCode, RelateName, ObjectId, RelatedObjectId, RelatedType,
            RelatedConfig, SortIndex, Status, Remarks, RelatedObjectName,
            RelatedObjectType, RelatedObjectRemarks, RelatedObjectPackageId,
            RelatedObjectPackageName, ObjectName, ObjectType, ObjectRemarks,
            ObjectPackageId, ObjectPackageName
        };
    public static final String[] ENTITY_PROPERTIES = new String[] {
            _DataObjectProperty.Id, _DataObjectProperty.RelateCode,
            _DataObjectProperty.RelateName, _DataObjectProperty.ObjectId,
            _DataObjectProperty.RelatedObjectId, _DataObjectProperty.RelatedType,
            _DataObjectProperty.RelatedConfig, _DataObjectProperty.SortIndex,
            _DataObjectProperty.Status, _DataObjectProperty.Remarks,
            _DataObjectProperty.RelatedObjectName,
            _DataObjectProperty.RelatedObjectType,
            _DataObjectProperty.RelatedObjectRemarks,
            _DataObjectProperty.RelatedObjectPackageId,
            _DataObjectProperty.RelatedObjectPackageName,
            _DataObjectProperty.ObjectName, _DataObjectProperty.ObjectType,
            _DataObjectProperty.ObjectRemarks,
            _DataObjectProperty.ObjectPackageId,
            _DataObjectProperty.ObjectPackageName
        };
    public static final String[] ENTITY_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_AUTO_GEN_PK_FIELDS = new String[] { Id };
    public static final String[] ENTITY_UNIQUE_FIELDS = new String[] {  };
    private static String relatedJoinSQL = null;
    private static String basicFilterSQL = null;
    private DataAccessObjectHelper<ProductModelObjectRelate, ProductModelObjectRelateDAOQueryBean> daoHelper;
    private com.ourteam.product.model.dao.impl.AbstractProductModelPropertyRelateDAOJdbcImpl ProductModelPropertyRelateDao;

    public AbstractProductModelObjectRelateDAOJdbcImpl() {
        super();
        daoHelper = new DataAccessObjectHelper<ProductModelObjectRelate, ProductModelObjectRelateDAOQueryBean>(this);
    }

    protected String getEntityName() {
        return EntityName;
    }

    protected String[] getEntityFields() {
        return ENTITY_FIELDS;
    }

    protected String[] getEntityProperties() {
        return ENTITY_PROPERTIES;
    }

    protected String[] getEntityPKFields() {
        return ENTITY_PK_FIELDS;
    }

    protected String[] getEntityAutoGenPKFields() {
        return ENTITY_AUTO_GEN_PK_FIELDS;
    }

    protected String[] getEntityUniqueFields() {
        return ENTITY_UNIQUE_FIELDS;
    }

    protected String getBaiscQueryFilter() {
        if (basicFilterSQL == null) {
            StringBuffer basicFilterSQLbuffer = new StringBuffer();

            basicFilterSQL = basicFilterSQLbuffer.toString();
        }

        return basicFilterSQL;
    }

    protected String getRelatedJoinSQL() {
        if (relatedJoinSQL == null) {
            StringBuffer relatedJoinSQLBuffer = new StringBuffer();

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName)
                                .append(" PRODUCT_MODEL_OBJECT ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelObjectDAO.Id,
                    com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName +
                    ".", "PRODUCT_MODEL_OBJECT."));
            relatedJoinSQLBuffer.append(" = ").append(RelatedObjectId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelPackageDAO.EntityName)
                                .append(" PRODUCT_MODEL_PACKAGE ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelPackageDAO.Id,
                    com.ourteam.product.model.dao.IProductModelPackageDAO.EntityName +
                    ".", "PRODUCT_MODEL_PACKAGE."));
            relatedJoinSQLBuffer.append(" = ").append(RelatedObjectPackageId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName)
                                .append(" MAIN_PRODUCT_MODEL_OBJECT ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelObjectDAO.Id,
                    com.ourteam.product.model.dao.IProductModelObjectDAO.EntityName +
                    ".", "MAIN_PRODUCT_MODEL_OBJECT."));
            relatedJoinSQLBuffer.append(" = ").append(ObjectId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQLBuffer.append(" LEFT JOIN ")
                                .append(com.ourteam.product.model.dao.IProductModelPackageDAO.EntityName)
                                .append(" MAIN_PRODUCT_MODEL_PACKAGE ");

            relatedJoinSQLBuffer.append(" ON ( ");

            relatedJoinSQLBuffer.append(StringUtils.replace(
                    com.ourteam.product.model.dao.IProductModelPackageDAO.Id,
                    com.ourteam.product.model.dao.IProductModelPackageDAO.EntityName +
                    ".", "MAIN_PRODUCT_MODEL_PACKAGE."));
            relatedJoinSQLBuffer.append(" = ").append(ObjectPackageId);

            relatedJoinSQLBuffer.append(" ) ");

            relatedJoinSQL = relatedJoinSQLBuffer.toString();
        }

        return relatedJoinSQL;
    }

    /**
         * Check Data Unique
         * @param aProductModelObjectRelate
         * @throws Exception
         */
    public boolean checkIsUnique(
        ProductModelObjectRelate aProductModelObjectRelate)
        throws Exception {
        if (aProductModelObjectRelate == null) {
            return true;
        }

        List valueList = new ArrayList();

        List pkValueList = new ArrayList();

        pkValueList.add(aProductModelObjectRelate.getId());

        return isUnique(valueList.toArray(new Object[valueList.size()]),
            pkValueList.toArray(new Object[pkValueList.size()]));
    }

    /**
     * Insert Data
     * @param aProductModelObjectRelate
     * @throws Exception
     */
    public void insert(ProductModelObjectRelate aProductModelObjectRelate)
        throws Exception {
        super.doInsert(aProductModelObjectRelate);
    }

    /**
         * Batch Insert Datas
         * @param aProductModelObjectRelate
         * @throws Exception
         */
    public void batchInsert(
        ProductModelObjectRelate[] aProductModelObjectRelates)
        throws Exception {
        super.doBatchInsert(aProductModelObjectRelates);
    }

    /**
         * Delete Data
         * @param  final long id         *
         * @throws Exception
         */
    public void delete(final long id) throws Exception {
        super.doDeleteById(new Object[] { new Long(id) });
    }

    /**
     * Delete Datas
     * @param queryBean
     * @throws Exception
     */
    public void delete(ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        super.doDeleteByQuery(queryBean);
    }

    public void delete(ProductModelObjectRelate aProductModelObjectRelate)
        throws Exception {
        delete(aProductModelObjectRelate.getId());
    }

    /**
     * Update Data Selective
     * @param aProductModelObjectRelate
     * @throws Exception
     */
    public void update(ProductModelObjectRelate aProductModelObjectRelate)
        throws Exception {
        if (aProductModelObjectRelate.getId() == 0) {
            throw new Exception(
                "Can not update object data whith out primary key value");
        }

        super.doUpdate(aProductModelObjectRelate);

        ProductModelObjectRelate tempObj = findById(aProductModelObjectRelate.getId());

        if (tempObj != null) {
            PropertyUtils.copyProperties(aProductModelObjectRelate, tempObj);
        }
    }

    /**
     * Batch Update Datas
     * @param aProductModelObjectRelates[]
     * @throws Exception
     */
    public void batchUpdate(
        ProductModelObjectRelate[] aProductModelObjectRelates)
        throws Exception {
        super.doBatchUpdate(aProductModelObjectRelates);
    }

    /**
         * Update Data By Condictions
         * @param aProductModelObjectRelate
         * @param aValueCriteria
         * @param aTransaction
         * @throws Exception
         */
    public void update(ProductModelObjectRelate aProductModelObjectRelate,
        ProductModelObjectRelateDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aProductModelObjectRelate, aQueryBean);
    }

    /**
     * Update Data By Condictions
     * @param aQueryBean
     * @throws Exception
     */
    public void update(ProductModelObjectRelateDAOQueryBean aQueryBean)
        throws Exception {
        super.doUpdateByQuery(aQueryBean);
    }

    protected void checkNullValue(
        ProductModelObjectRelate aProductModelObjectRelate)
        throws Exception {
        if (aProductModelObjectRelate.getRelateCode() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relateCode value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelateName() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relateName value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedType() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedType value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedConfig() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedConfig value is not allow NULL");
        }

        if (aProductModelObjectRelate.getStatus() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.status value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRemarks() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.remarks value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedObjectName() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedObjectName value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedObjectType() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedObjectType value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedObjectPackageName() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedObjectPackageName value is not allow NULL");
        }

        if (aProductModelObjectRelate.getRelatedObjectRemarks() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.relatedObjectRemarks value is not allow NULL");
        }

        if (aProductModelObjectRelate.getObjectName() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.objectName value is not allow NULL");
        }

        if (aProductModelObjectRelate.getObjectType() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.objectType value is not allow NULL");
        }

        if (aProductModelObjectRelate.getObjectRemarks() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.objectRemarks value is not allow NULL");
        }

        if (aProductModelObjectRelate.getObjectPackageName() == null) {
            throw new Exception(
                "The ProductModelObjectRelate.objectPackageName value is not allow NULL");
        }
    }

    /**
     * Get Data By ID
     * @param  final long id         * @return  ${businessObject.name}
     * @throws Exception
     */
    public ProductModelObjectRelate findById(final long id)
        throws Exception {
        ProductModelObjectRelateDAOQueryBean queryBean = new ProductModelObjectRelateDAOQueryBean();

        ProductModelObjectRelateDAOQueryBean.Criteria criteria = queryBean.createCriteria();

        criteria.andIdEqualTo(id);

        //queryBean.setDistinct(true);
        ProductModelObjectRelate[] ProductModelObjectRelates = query(queryBean);

        if (ProductModelObjectRelates.length == 0) {
            return null;
        } else {
            return ProductModelObjectRelates[0];
        }
    }

    /**
         * Query Data
         * @param queryBean
         * @return ProductModelObjectRelate[]
         * @throws Exception
         */
    public ProductModelObjectRelate[] query(
        ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        List result = super.doQuery(queryBean,
                new JdbcProductModelObjectRelateRowMapper());

        return (ProductModelObjectRelate[]) result.toArray(new ProductModelObjectRelate[result.size()]);
    }

    /**
     * Query ${businessObject.name} Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] querySelective(
        ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addAllSelectProperties();
        }

        return super.doQuerySelective(queryBean);
    }

    /**
     * Query Data Count
     * @param queryBean
     * @return int
     * @throws Exception
     */
    public int queryCount(ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        return super.doQueryCount(queryBean);
    }

    public void synchronize(
        ProductModelObjectRelate[] aProductModelObjectRelates,
        ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        daoHelper.synchronize(aProductModelObjectRelates, queryBean);
    }

    public void synchronize(
        ProductModelObjectRelate[] aProductModelObjectRelates,
        ProductModelObjectRelateDAOQueryBean queryBean,
        net.dao.IDataAccessInterface.ISynchronizeCallback<ProductModelObjectRelate> callBack)
        throws Exception {
        daoHelper.synchronize(aProductModelObjectRelates, queryBean, callBack);
    }

    public void setProductModelPropertyRelateDao(
        com.ourteam.product.model.dao.IProductModelPropertyRelateDAO ProductModelPropertyRelateDao) {
        this.ProductModelPropertyRelateDao = (com.ourteam.product.model.dao.impl.AbstractProductModelPropertyRelateDAOJdbcImpl) ProductModelPropertyRelateDao;
    }

    /**
     * Query Related ProductModelPropertyRelate
    * @param queryBean
     * @throws Exception
     */
    public com.ourteam.product.model.dao.ProductModelPropertyRelate[] queryProductModelPropertyRelate(
        ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.EntityName +
            " ref_ProductModelPropertyRelate";

        String[] entityFields = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.ENTITY_PROPERTIES;

        List list = ProductModelPropertyRelateDao.doQuery(entityName,
                entityFields, entityProperties, queryBean, joinSQL.toString(),
                new com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.JdbcProductModelPropertyRelateRowMapper());

        return (com.ourteam.product.model.dao.ProductModelPropertyRelate[]) list.toArray(new com.ourteam.product.model.dao.ProductModelPropertyRelate[list.size()]);
    }

    /**
     * Query Related ProductModelPropertyRelate Selective
     * @param queryBean
     * @return Map[]
     * @model
     * @throws Exception
     */
    public Map<String, Object>[] queryProductModelPropertyRelateSelective(
        ProductModelObjectRelateDAOQueryBean queryBean)
        throws Exception {
        if (queryBean.getSelectProperties().isEmpty()) {
            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Id,
                "id");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelateCode,
                "relateCode");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelateName,
                "relateName");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.PropertyId,
                "propertyId");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedPropertyId,
                "relatedPropertyId");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedType,
                "relatedType");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.RelatedConfig,
                "relatedConfig");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.SortIndex,
                "sortIndex");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Status,
                "status");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.Remarks,
                "remarks");

            queryBean.addSelectProperty(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId,
                "objectRelatedId");
        }

        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.EntityName +
            " ref_ProductModelPropertyRelate";

        return ProductModelPropertyRelateDao.doQuerySelective(entityName,
            queryBean, joinSQL.toString());
    }

    /**
     * Update Related ProductModelPropertyRelate
     * @param aProductModelPropertyRelate
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void updateProductModelPropertyRelate(
        com.ourteam.product.model.dao.ProductModelPropertyRelate aProductModelPropertyRelate,
        ProductModelObjectRelateDAOQueryBean aQueryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.EntityName +
            " ref_ProductModelPropertyRelate";

        String[] entityFields = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.ENTITY_FIELDS;

        String[] entityProperties = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.ENTITY_PROPERTIES;

        ProductModelPropertyRelateDao.doUpdateByQuery(entityName, entityFields,
            entityProperties, joinSQL.toString(), aProductModelPropertyRelate,
            aQueryBean);
    }

    /**
     * Delete Related ProductModelPropertyRelate
     * @param aQueryBean
     * @model
     * @throws Exception
     */
    public void deleteProductModelPropertyRelate(
        ProductModelObjectRelateDAOQueryBean aQueryBean)
        throws Exception {
        StringBuffer joinSQL = new StringBuffer();

        joinSQL.append(" LEFT JOIN ").append(EntityName).append(" ON ( ");

        joinSQL.append(com.ourteam.product.model.dao.IProductModelPropertyRelateDAO.ObjectRelatedId)
               .append(" = ").append(Id);

        joinSQL.append(" ) ");

        String entityName = com.ourteam.product.model.dao.impl.ProductModelPropertyRelateDAO.EntityName; // + " ref_ProductModelPropertyRelate";

        ProductModelPropertyRelateDao.doDeleteByQuery(entityName,
            joinSQL.toString(), aQueryBean);
    }

    public static class JdbcProductModelObjectRelateRowMapper
        implements RowMapper<ProductModelObjectRelate> {
        public ProductModelObjectRelate mapRow(ResultSet resultSet, int arg1)
            throws SQLException {
            ProductModelObjectRelate object = new ProductModelObjectRelate();

            int columnIndex = 1;

            int __dataType;

            try {
                Object id = null;

                id = resultSet.getObject(columnIndex++);

                object.setIdNull(resultSet.getBoolean(columnIndex++));

                if (id != null) {
                    setBeanValue(object, _DataObjectProperty.Id, id);
                }

                Object relateCode = null;

                relateCode = resultSet.getObject(columnIndex++);

                object.setRelateCodeNull(resultSet.getBoolean(columnIndex++));

                if (relateCode != null) {
                    setBeanValue(object, _DataObjectProperty.RelateCode,
                        relateCode);
                }

                Object relateName = null;

                relateName = resultSet.getObject(columnIndex++);

                object.setRelateNameNull(resultSet.getBoolean(columnIndex++));

                if (relateName != null) {
                    setBeanValue(object, _DataObjectProperty.RelateName,
                        relateName);
                }

                Object objectId = null;

                objectId = resultSet.getObject(columnIndex++);

                object.setObjectIdNull(resultSet.getBoolean(columnIndex++));

                if (objectId != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectId, objectId);
                }

                Object relatedObjectId = null;

                relatedObjectId = resultSet.getObject(columnIndex++);

                object.setRelatedObjectIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectId != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedObjectId,
                        relatedObjectId);
                }

                Object relatedType = null;

                relatedType = resultSet.getObject(columnIndex++);

                object.setRelatedTypeNull(resultSet.getBoolean(columnIndex++));

                if (relatedType != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedType,
                        relatedType);
                }

                Object relatedConfig = null;

                relatedConfig = resultSet.getObject(columnIndex++);

                object.setRelatedConfigNull(resultSet.getBoolean(columnIndex++));

                if (relatedConfig != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedConfig,
                        relatedConfig);
                }

                Object sortIndex = null;

                sortIndex = resultSet.getObject(columnIndex++);

                object.setSortIndexNull(resultSet.getBoolean(columnIndex++));

                if (sortIndex != null) {
                    setBeanValue(object, _DataObjectProperty.SortIndex,
                        sortIndex);
                }

                Object status = null;

                status = resultSet.getObject(columnIndex++);

                object.setStatusNull(resultSet.getBoolean(columnIndex++));

                if (status != null) {
                    setBeanValue(object, _DataObjectProperty.Status, status);
                }

                Object remarks = null;

                remarks = resultSet.getObject(columnIndex++);

                object.setRemarksNull(resultSet.getBoolean(columnIndex++));

                if (remarks != null) {
                    setBeanValue(object, _DataObjectProperty.Remarks, remarks);
                }

                Object relatedObjectName = null;

                relatedObjectName = resultSet.getObject(columnIndex++);

                object.setRelatedObjectNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectName != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedObjectName,
                        relatedObjectName);
                }

                Object relatedObjectType = null;

                relatedObjectType = resultSet.getObject(columnIndex++);

                object.setRelatedObjectTypeNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectType != null) {
                    setBeanValue(object, _DataObjectProperty.RelatedObjectType,
                        relatedObjectType);
                }

                Object relatedObjectRemarks = null;

                relatedObjectRemarks = resultSet.getObject(columnIndex++);

                object.setRelatedObjectRemarksNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectRemarks != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedObjectRemarks,
                        relatedObjectRemarks);
                }

                Object relatedObjectPackageId = null;

                relatedObjectPackageId = resultSet.getObject(columnIndex++);

                object.setRelatedObjectPackageIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectPackageId != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedObjectPackageId,
                        relatedObjectPackageId);
                }

                Object relatedObjectPackageName = null;

                relatedObjectPackageName = resultSet.getObject(columnIndex++);

                object.setRelatedObjectPackageNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (relatedObjectPackageName != null) {
                    setBeanValue(object,
                        _DataObjectProperty.RelatedObjectPackageName,
                        relatedObjectPackageName);
                }

                Object objectName = null;

                objectName = resultSet.getObject(columnIndex++);

                object.setObjectNameNull(resultSet.getBoolean(columnIndex++));

                if (objectName != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectName,
                        objectName);
                }

                Object objectType = null;

                objectType = resultSet.getObject(columnIndex++);

                object.setObjectTypeNull(resultSet.getBoolean(columnIndex++));

                if (objectType != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectType,
                        objectType);
                }

                Object objectRemarks = null;

                objectRemarks = resultSet.getObject(columnIndex++);

                object.setObjectRemarksNull(resultSet.getBoolean(columnIndex++));

                if (objectRemarks != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectRemarks,
                        objectRemarks);
                }

                Object objectPackageId = null;

                objectPackageId = resultSet.getObject(columnIndex++);

                object.setObjectPackageIdNull(resultSet.getBoolean(
                        columnIndex++));

                if (objectPackageId != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectPackageId,
                        objectPackageId);
                }

                Object objectPackageName = null;

                objectPackageName = resultSet.getObject(columnIndex++);

                object.setObjectPackageNameNull(resultSet.getBoolean(
                        columnIndex++));

                if (objectPackageName != null) {
                    setBeanValue(object, _DataObjectProperty.ObjectPackageName,
                        objectPackageName);
                }

                return object;
            } catch (Exception e) {
                throw new SQLException(e.getMessage());
            }
        }
    }
}
